package org.subject.dao;

import org.subject.dto.RegisteMessage;
import org.subject.dto.RegisteUserMessage;
import org.subject.entity.Registration;
import org.subject.entity.User;

import java.util.List;
import java.util.Map;

public interface RegistrationMapper {
    int deleteByPrimaryKey(Long registrationId);

    int insert(Registration record);

    int insertSelective(Registration record);

    Registration selectByPrimaryKey(Long registrationId);

    int updateByPrimaryKeySelective(Registration record);

    int updateByPrimaryKey(Registration record);

    /**
     * 根据messageId查询出所有的报名用户
     *
     * @param messageId
     * @return
     */
    List<User> selectUserList(Long messageId);

    /**
     * 根据用户id和信息id查询
     *
     * @param record
     * @return
     */
    Registration selectByMIdUid(Registration record);

    /**
     * 查询出所有的参考相关竞赛
     *
     * @param messageId
     * @return
     */
    List<RegisteMessage> selectRegisteMessage(Long messageId);

    /**
     * 根据userid查询出所有的参考相关竞赛
     *
     * @param userId
     * @return
     */
    List<RegisteUserMessage> selectRegisteUserMessage(Long userId);

    /**
     * 根据竞赛信息id和院系id查询报名列表
     *
     * @param paramter
     * @return
     */
    List<User> selectUserListByFId(Map<String, Object> paramter);
}